<div id="form"></div>
<script>
var frm=$("#form").ajajform({
	header: null,
	footerButtons: [
		{value: "Создать",url: "{{action}}?mode=edit"}
	]
});
var grid=frm.ajajform("insertWidget",null,null,{
	type: "grid",
	title: "Формы",
	name: "forms",
	rowClasses: [{
		name:"item",
		columns: [
			{name: "code", label: "Код", width: 200, url: '{{action}}?mode=edit&form_id='},
			{name: "name", label: "Название", width: 300, url: '{{action}}?mode=edit&form_id='},
			{name: "header", label: "Заголовок", width: 400},
			{name: "sql", label: " ", width: 100, url: '{{action}}?mode=sql&form_id='}
		]
	}]
});
var rows={{JSON_gridrower("code,name,header"):forms}};
for (var i=0;i<rows.length;i++) {
	var row=rows[i];
	row.cells.push("SQL");
	grid.ajajform_grid("insertRow",null,row);
}
</script>
